<template>
  <div>
    <el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Title">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
        <el-form-item label="项目名称" prop="field102">
          <el-input v-model="formData.field102" placeholder="请输入项目名称" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
        <el-form-item label="开始日期" prop="field109">
          <el-date-picker v-model="formData.field109" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
                          :style="{width: '100%'}" placeholder="请选择开始日期" clearable></el-date-picker>
        </el-form-item>
        <el-form-item label="结束日期" prop="field110">
          <el-date-picker v-model="formData.field110" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
                          :style="{width: '100%'}" placeholder="请选择结束日期" clearable></el-date-picker>
        </el-form-item>
        <el-form-item label="项目预算" prop="field111">
          <el-input v-model="formData.field111" placeholder="请输入项目预算" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
        <el-form-item label="公司id" prop="field112">
          <el-input v-model="formData.field112" placeholder="请输入公司id" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="handleConfirm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  inheritAttrs: false,
  components: {},
  props: [],
  data() {
    return {
      formData: {
        field102: undefined,
        field109: null,
        field110: null,
        field111: undefined,
        field112: undefined,
      },
      rules: {
        field102: [{
          required: true,
          message: '请输入项目名称',
          trigger: 'blur'
        }],
        field109: [{
          required: true,
          message: '请选择开始日期',
          trigger: 'change'
        }],
        field110: [{
          required: true,
          message: '请选择结束日期',
          trigger: 'change'
        }],
        field111: [{
          required: true,
          message: '请输入项目预算',
          trigger: 'blur'
        }],
        field112: [{
          required: true,
          message: '请输入公司id',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {
  },
  mounted() {
  },
  methods: {
    onOpen() {
    },
    onClose() {
      this.$refs['elForm'].resetFields()
    },
    close() {
      this.$emit('update:visible', false)
    },
    handleConfirm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        this.close()
      })
    },
  }
}

</script>
<style>
</style>
